<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/

Route::get('/', 'WelcomeController@index');

Route::get('home', 'HomeController@index');




// 后台用户控制器

//用户登录
Route::get('admin/login', 'Admin\LoginController@login');
Route::post('admin/login', 'Admin\LoginController@login'); //登录post提交
Route::get('admin/code', 'Admin\LoginController@code');  //验证码
Route::get('admin/crypt', 'Admin\LoginController@crypt');  //加密

//添加分类


	Route::get('admin/index', 'Admin\IndexController@index');
	Route::get('admin/add', 'Admin\CateController@add');
	Route::post('admin/add', 'Admin\CateController@add');

	//添加文章
	Route::get('admin/l', 'Admin\ListController@index');
	Route::post('admin/la', 'Admin\ListController@add');
	// Route::resource('admin/uploads', 'Admin\ListController@uploads'); //上传图片类
	// Route::resource('admin/uploads', 'PhotoController', ['only' => ['uploads']]);
	// Route::post('admin/uploads', 'Admin\ListController@uploads'); //上传图片类
	Route::get('admin/lall', 'Admin\ListController@ListAll'); //文章管理
	Route::get('admin/ls_ls/{id}', 'Admin\ListController@Listlist'); //文章管理
	Route::get('admin/ls_bj/{id}', 'Admin\ListController@ListBianJi'); //文章编辑



Route::group(['namespace' => 'Admin'], function(){
 // 控制器在 "App\Http\Controllers\Admin" 命名空间下
	// Route::get('admin/index', 'IndexController@index');
});


Route::group(['middleware' => 'admin.user'], function () {
	Route::get('user', function () {
		// session(['key'=>123]);
	 	return 'User ';
	});
	// Route::get('uk', function () {
	// 	echo session('key');
	//  return 'UK';
	// });
});

Route::controllers([
	'auth' => 'Auth\AuthController',
	'password' => 'Auth\PasswordController',
]);
